//
//  UIButton+Extension.swift
//  SwiftSina
//
//  Created by Jason Ding on 16/8/17.
//  Copyright © 2016年 Jason Ding. All rights reserved.
//

import UIKit

extension UIButton{
    
    /// 便利构造函数
    convenience init(imageName:String, bgImageName:String){
        self.init()
        
        setBackgroundImage(UIImage(named: bgImageName), forState: .Normal)
        setBackgroundImage(UIImage(named: bgImageName + "_highlighted"), forState: .Highlighted)
        setImage(UIImage(named: imageName), forState: .Normal)
        setImage(UIImage(named: imageName + "_highlighted"), forState: .Highlighted)
        sizeToFit()
        
    }
}
